//-------------------------------------------------------------------
//	Copyright (c) 2012-2014 Zhirnov Andrey
//	This file is part of the "UXGEN-ES" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------

#pragma once

#include "Platforms/Base/IPlatform.h"

namespace Engine
{
namespace Platforms
{

	//
	// Application Interface
	//

	class IApplication : public IParallelThread
	{
	// variables
	protected:
		Ptr< IPlatform >		_platform;


	// methods
	public:
		IApplication (IPlatform *platform) : _platform(platform)
		{
			ESS()->SetApplication( this );
		}

		~IApplication ()
		{
			ESS()->SetApplication( null );
		}


		Ptr< IPlatform >	GetPlatform ()		{ return _platform; }


	// interface
	public:
		virtual void Destroy () = 0;
	};


}	// Platforms


	extern void (* g_CreateMainApplication) (Platforms::IPlatform *, Platforms::IApplication *&);

}	// Engine